<template>
  <div class="error-page">
    <div class="error-content">
      <el-icon class="error-icon" color="#F56C6C" :size="80">
        <Warning />
      </el-icon>
      <h1 class="error-title">404</h1>
      <p class="error-description">抱歉，您访问的页面不存在</p>
      <div class="error-actions">
        <el-button type="primary" @click="goHome">返回首页</el-button>
        <el-button @click="goBack">返回上一页</el-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { Warning } from '@element-plus/icons-vue'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style scoped lang="scss">
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: #f5f7fa;
  
  .error-content {
    text-align: center;
    
    .error-icon {
      margin-bottom: 20px;
    }
    
    .error-title {
      font-size: 48px;
      font-weight: 600;
      color: #303133;
      margin: 0 0 20px 0;
    }
    
    .error-description {
      font-size: 20px;
      color: #606266;
      margin: 0 0 30px 0;
    }
    
    .error-actions {
      .el-button {
        margin: 0 10px;
      }
    }
  }
}
</style>